import { defineStore } from 'pinia'
import { getGoodDetail } from '@/service/module/goods/goods'
interface GoodType {
  goodDetail: any
}

export const useGoodDetailStore = defineStore('useGoodDetail', {
  state: (): GoodType => ({
    goodDetail: {},
  }),
  actions: {
    // 获取商品
    async getGoodDetail(id: string) {
      const res = await getGoodDetail(id)
      this.goodDetail = res.data
    },
  },
})
